﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Webpartlist.aspx.cs" Inherits="Cms.Web.CmsSystem.SysModules.Portal.Webpartlist" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>webpart列表</title>
    <link href="../../../App_Themes/default/CoreEdit.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="/Scripts/core.js" type="text/javascript"></script>
    <link href="/App_Themes/Default/easyui/easyui.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/Scripts/jqGrid/lan/grid.locale-cn.js" type="text/javascript"></script>
    <link href="/App_Themes/Default/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link href="/App_Themes/Default/jqueryui/jquery-ui-1.7.1.custom.css" rel="stylesheet"
        type="text/css" />
    <script src="/Scripts/jqGrid/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var jgGridjsonReader = { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, cell: "cell", id: "Id", userdata: "userdata", subgrid: { root: "rows", repeatitems: true, cell: "cell"} };
        $(function() {
            var winw = GetInnerWidth();
            var winh = GetInnerHeight();
            jQuery("#tblist").jqGrid({
                datatype: "json",
                url: "/Tools/JSON.ashx?param=ctrl&type=jqgrid&act=getwebpartlist",
                height: winh - 100,
                rownumbers: false,
                loadonce: true,
                jsonReader: jgGridjsonReader,
                colNames: ['主键', '编号', '标题'],
                colModel: [
                     { name: 'Id', index: 'Id', width: 80, hidden: true, key: true },
                     { name: 'Alias', index: 'Alias', width: 120 },
                     { name: 'Title', index: 'Title', width: 150 }
                    ],
                pager: '#gridpagertblist'
            });
            $("#btnAdd").click(function() {
                OpenUrlOnTab("/CmsSystem/SysAdmin/Portal/Webpart.aspx?action=add", "增加webpart", $(this), { type: "div" });
            });
            $("#btnModify").click(function() {
                var sid = jQuery("#tblist").getGridParam("selrow");
                if (sid) {
                    var url = "/CmsSystem/SysAdmin/Portal/Webpart.aspx?action=modify&RecID=" + sid;
                    OpenUrlOnTab(url, "修改webpart", $("#" + sid), { type: "div" });
                }
            });
        });
    </script>

</head>
<body style="margin:0;padding:0;">
    <div>
        <input type="button" id="btnAdd" class="button" value="添加" />
        <input type="button" id="btnModify" class="button" value="修改" />
    </div>
    <div>
        <table id="tblist">
        </table>
        <div id="gridpagertblist">
        </div>
    </div>
</body>
</html>
